/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package healthcare.coursework.model;

import java.io.Serializable;
import java.util.List;

/**
 *
 * @author Administrator
 */

public class Specialization implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer specializationId;
    private String specializationName;
    private String description;
    private boolean isDeleted;
    private List<Users> users;

    public Specialization() {
    }

    public Specialization(Integer specializationId) {
        this.specializationId = specializationId;
    }

    public Specialization(Integer specializationId, String specializationName, boolean isDeleted) {
        this.specializationId = specializationId;
        this.specializationName = specializationName;
        this.isDeleted = isDeleted;
    }

    public Integer getSpecializationId() {
        return specializationId;
    }

    public void setSpecializationId(Integer specializationId) {
        this.specializationId = specializationId;
    }

    public String getSpecializationName() {
        return specializationName;
    }

    public void setSpecializationName(String specializationName) {
        this.specializationName = specializationName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public boolean getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    public List<Users> getUsers() {
        return users;
    }

    public void setUsers(List<Users> users) {
        this.users = users;
    }




    @Override
    public int hashCode() {
        int hash = 0;
        hash += (specializationId != null ? specializationId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Specialization)) {
            return false;
        }
        Specialization other = (Specialization) object;
        if ((this.specializationId == null && other.specializationId != null) || (this.specializationId != null && !this.specializationId.equals(other.specializationId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "healthcare.coursework.model.Specialization[specializationId=" + specializationId + "]";
    }

    public void addUsers(Users user) {
        getUsers().add(user);
        user.setSpecialization(this);
    }

}
